/*
 * PingStats.cpp
 *
 *  Created on: Jun 21, 2013
 *      Author: shaohong
 */

#include "PingStats.h"
#include <sstream>

using namespace std;

namespace dnm {

PingStats::PingStats() {
	successful=false;	// whether the ping was successful
	rtt_min = 0.0;
	rtt_max = 0.0;
	rtt_avg = 0.0;
	rtt_mdev = 0.0;
	numOfPktSent = 0;
	numOfPktRcvd = 0;
}

PingStats::~PingStats() {
}

string PingStats::toString() {
	stringstream os;
	os << "PingStats { " << "successful=" << (successful ? "true":"false")
			<< ", hostName=" << hostName << ", hostIP=" << hostIP
			<< ", numOfPktSent=" << numOfPktSent << ", numOfPktRcvd=" << numOfPktRcvd
			<< ", rtt_min=" << rtt_min << ", rtt_max=" << rtt_max
			<< ", rtt_avg=" << rtt_avg << ", rtt_mdev=" << rtt_mdev << "}";

	return os.str();
}

} /* namespace dnm */
